﻿Public Class UserBUS
    Private userdao As New UserDAO()
    Public Function GetUserByUserName(ByVal _username As String) As DataSet
        Return userdao.GetUserByUserName(_username)
    End Function

    Public Function GetPass(ByVal _username As String) As String
        Return userdao.GetPass(_username)
    End Function

    Public Function ChangePass(ByVal _username As String, ByVal _password As String) As Boolean
        Return userdao.ChangePass(_username, _password)
    End Function

    Public Function UserAccountsWithUserAccountID_Lookup() As DataSet
        Return userdao.UserAccountsWithUserAccountID_Lookup()
    End Function

    Public Function UserAccounts_Select(ByVal Username As String) As DataSet
        Return userdao.UserAccounts_Select(Username)
    End Function

    Public Function UserAccounts_Insert(ByVal Name As String, _
                                        ByVal FullName As String, _
                                        ByVal Description As String, _
                                        ByVal Office As String, _
                                        ByVal PhoneNumber As String, _
                                        ByVal EmailAddress As String, _
                                        ByVal Password As String, _
                                        ByVal PasswordChgAtLogonFlag As Boolean, _
                                        ByVal CannotChgPasswordFlag As Boolean, _
                                        ByVal StatusFlag As Boolean, _
                                        ByVal CashBookFlag As Boolean, _
                                        ByVal ModifiedOn As Date, _
                                        ByVal ModifiedBy As String, _
                                        ByVal CreatedOn As Date, _
                                        ByVal CreatedBy As String) As DataSet
        Return userdao.UserAccounts_Insert(Name, FullName, Description, Office, PhoneNumber, EmailAddress, Password, PasswordChgAtLogonFlag, CannotChgPasswordFlag, StatusFlag, CashBookFlag, ModifiedOn, ModifiedBy, CreatedOn, CreatedBy)
    End Function

    Public Function UserAccounts_Update(ByVal UserAccountID As Integer, _
                                        ByVal Name As String, _
                                        ByVal FullName As String, _
                                        ByVal Description As String, _
                                        ByVal Office As String, _
                                        ByVal PhoneNumber As String, _
                                        ByVal EmailAddress As String, _
                                        ByVal Password As String, _
                                        ByVal PasswordChgAtLogonFlag As Boolean, _
                                        ByVal CannotChgPasswordFlag As Boolean, _
                                        ByVal StatusFlag As Boolean, _
                                        ByVal CashBookFlag As Boolean, _
                                        ByVal ModifiedOn As Date, _
                                        ByVal ModifiedBy As String, _
                                        ByVal CreatedOn As Date, _
                                        ByVal CreatedBy As String) As Boolean
        Return userdao.UserAccounts_Update(UserAccountID, Name, FullName, Description, Office, PhoneNumber, EmailAddress, Password, PasswordChgAtLogonFlag, CannotChgPasswordFlag, StatusFlag, CashBookFlag, ModifiedOn, ModifiedBy, CreatedOn, CreatedBy)
    End Function

    Public Function UserAccounts_Delete(ByVal UserAccountID As Integer) As Boolean
        Return userdao.UserAccounts_Delete(UserAccountID)
    End Function

    Public Function UserAccounts_Update_Email(ByVal UserAccountID As Integer, _
                                              ByVal Email As String) As Boolean
        Return userdao.UserAccounts_Update_Email(UserAccountID, Email)
    End Function

    Public Function UserAccounts_Update_Name(ByVal UserAccountID As Integer, _
                                              ByVal Name As String) As Boolean
        Return userdao.UserAccounts_Update_Name(UserAccountID, Name)
    End Function

    Public Function UserAccounts_Update_FullName(ByVal UserAccountID As Integer, _
                                              ByVal FullName As String) As Boolean
        Return userdao.UserAccounts_Update_FullName(UserAccountID, FullName)
    End Function

    Public Function UserAccounts_Update_PhoneNumber(ByVal UserAccountID As Integer, _
                                                    ByVal PhoneNumber As String) As Boolean
        Return userdao.UserAccounts_Update_PhoneNumber(UserAccountID, PhoneNumber)
    End Function

    Public Function UserAccounts_Check(ByVal Username As String) As Boolean
        Return userdao.UserAccounts_Check(Username)
    End Function

    Public Function UserAccounts_Lookup() As DataSet
        Return userdao.UserAccounts_Lookup()
    End Function

    Public Function UserAccounts_List() As DataSet
        Return userdao.UserAccounts_List()
    End Function


End Class
